package com.xbai.goods.dao;

import com.xbai.goods.pojo.Brand;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @author jxbai
 * @desc BrandMapper
 * @date 2021/1/28
 */
public interface BrandMapper extends Mapper<Brand> {

    /**
     * 查询分类对应的品牌集合
     * @param categoryId 分类id
     * @return {@link Brand}
     */
    @Select("select tb.* from tb_category_brand tcb, tb_brand tb where tcb.category_id = #{categoryId} and tb.id=tcb.brand_id")
    List<Brand> findByCategoryId(Integer categoryId);
}
